/* 现代化图片管理样式 */

/* 主容器样式 */
#slider-images-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
}

/* 现代化图片卡片 */
.modern-image-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.modern-image-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* 卡片容器 */
.image-card-container {
    position: relative;
    height: 100%;
}

/* 卡片头部 */
.image-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 1px solid #e5e7eb;
}

.card-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.card-title h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.card-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
    display: block;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn-card-action {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-card-action:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.btn-card-action.btn-remove:hover {
    background: #ef4444;
}

/* 卡片主体 */
.image-card-body {
    padding: 20px;
    display: flex;
    gap: 20px;
}

/* 图片预览区域 */
.image-preview-section {
    flex: 0 0 150px;
}

.image-preview-container {
    width: 150px;
    height: 100px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.image-preview-container:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.image-preview-container.has-image {
    border-style: solid;
    border-color: #10b981;
    background: #ecfdf5;
}

.image-placeholder {
    text-align: center;
    color: #6b7280;
    font-size: 12px;
}

.image-placeholder i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* 表单区域 */
.image-form-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-col {
    flex: 1;
}

.form-col-full {
    flex: 1;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input:read-only {
    background: #f9fafb;
    color: #6b7280;
}

/* 图片上传组 */
.image-upload-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.image-upload-group .form-input {
    flex: 1;
}

.upload-actions {
    display: flex;
    gap: 4px;
}

.upload-actions button {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-upload {
    background: #ef4444;
    color: white;
}

.btn-upload:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-collect {
    background: #10b981;
    color: white;
}

.btn-collect:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-article {
    background: #3b82f6;
    color: white;
}

.btn-article:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* 图片预览列表 */
.image-preview-list {
    margin: 12px 0 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.image-preview-list li {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.image-preview-list img {
    width: 60px;
    height: 40px;
    object-fit: cover;
    display: block;
}

.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-preview-list li:hover .img-overlay {
    opacity: 1;
}

.img-remove {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 10px;
    cursor: pointer;
}

/* 卡片状态指示器 */
.card-status-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-empty {
    background: #ef4444;
}

.status-filled {
    background: #10b981;
}

.status-processing {
    background: #f59e0b;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 添加图片按钮区域 */
.text-center {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

#add-image-group {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#add-image-group:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

#add-image-group.disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#add-image-group i {
    font-size: 16px;
}

/* 图片预览模态框样式 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-modal.show {
    opacity: 1;
    visibility: visible;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.image-modal.show .image-modal-content {
    transform: scale(1);
}

.image-modal-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-modal-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.image-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.image-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.image-modal-body {
    padding: 0;
    text-align: center;
}

.image-modal-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

/* 拖拽功能样式 */
.card-drag-handle {
    cursor: grab;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.card-drag-handle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.card-drag-handle:active {
    cursor: grabbing;
}

.modern-image-card.dragging {
    opacity: 0.7;
    transform: rotate(2deg);
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: none;
}

.drag-placeholder {
    background-color: rgba(0, 123, 255, 0.1);
    border: 2px dashed #007bff;
    border-radius: 8px;
    margin: 10px 0;
    position: relative;
}

.drag-placeholder::before {
    content: "拖拽到此处";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #007bff;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #slider-images-container {
        gap: 15px;
    }
    
    .modern-image-card {
        margin-bottom: 15px;
    }
    
    .image-card-body {
        flex-direction: column;
        gap: 16px;
    }
    
    .image-preview-section {
        flex: none;
        align-self: center;
    }
    
    .form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .upload-actions {
        flex-wrap: wrap;
    }
    
    .upload-actions button {
        flex: 1;
        min-width: 80px;
    }
    
    /* 移动端拖拽优化 */
    .card-drag-handle {
        padding: 8px;
        font-size: 16px;
    }
    
    .drag-placeholder::before {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .card-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-card-action {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .image-card-header {
        padding: 12px 16px;
    }
    
    .image-card-body {
        padding: 16px;
    }
}

/* 拖拽排序样式 */
.sortable-ghost {
    opacity: 0.5;
}

.sortable-chosen {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.sortable-drag {
    transform: rotate(5deg);
}

/* 动画效果 */
.modern-image-card {
    animation: slideInUp 0.3s ease-out;
}

.modern-image-card.removing {
    animation: slideOutDown 0.3s ease-in forwards;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

/* 加载状态 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 100;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}